//
//  NSRange.swift
//  yzb
//
//  Created by cyptt on 2021/12/13.
//

import UIKit

extension NSRange {
    public  func toRange(string: String) -> Range<String.Index>
    {
        let startIndex = string.index(string.startIndex, offsetBy: self.location)
        let endIndex = string.index(startIndex, offsetBy: self.length)
        return startIndex..<endIndex
    }
}
